﻿namespace Ecobee.Net
{
	/// <summary>
	/// The response status object contains the processing status of the request. It will contain 
	/// any relevant error information should an error occur. The status object is returned with 
	/// every response regardless of success or failure status. It is suitable for logging request 
	/// failures.
	/// </summary>
	public class Status : ApiObject
	{
		/// <summary>
		/// The status code for this status.
		/// </summary>
		public int Code { get; set; }

		/// <summary>
		/// The detailed message for this status. 
		/// </summary>
		public string Message { get; set; }

		protected override void OnFromDataObject(dynamic dataObject)
		{
			this.Code = dataObject.code;
			this.Message = dataObject.message;
		}
	}
}
